Ejemplos de guiones
Con Thinking Home se puede usar AppleScript con un diccionario completo. Se puede navegar con cualquier editor de guiones. Lo que no se ve en el diccionario es que usted puede referirse a los dispositivos de distintas formas. Prácticamente cualquier forma funcionará. Por ejemplo, los ejemplos que figuran a continuación para “encender” son todos equivalentes.
Estos son algunos ejemplos de AppleScript en Thinking Home.
Refiriéndose a un dispositivo |
-- Puede trabajar con los dispositivos de la forma que prefiera. tell application "Thinking Home"
turn on the "Luz del porche"
end tellturn on "P16" turn on device "Luz del porche" turn on device 3 tell the "Luz del porche" of application "Thinking Home"
turn on
end telltell application "Thinking Home"
tell the "Luz del porche"
end tell
turn on
end tell |
Para atenuar y aumentar la intensidad de la luz |
-- Atenuar y aumentar la intensidad de la luz también es fácil. tell application "Thinking Home"
dim the "Luz del porche"-- el valor por omisión es 35%
end tell
brighten the "Luz del porche" by 80 -- por ciento dim the "Luz del porche" to 20 -- por ciento |
Hora de la salida y la puesta del sol |
tell application "Thinking Home"
set miPuestaDelSol to the sunrise for the current date
end tellset miSalidaDelSol to the sunset for the current date |